<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('comments', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('userid')->comment('用户id');
            $table->string('nickname')->comment('用户昵称');
            $table->string('useravatar')->comment('用户头像');
            $table->string('ordernumber')->unique()->comment('订单号');
            $table->integer('shopid')->comment('商家id');
            $table->double('score','12,2')->default(0.0)->comment('评分');
            $table->string('content')->comment('评论内容');
            $table->string('picture', 512)->default('')->comment('评论图片');
            $table->dateTime('commenttime')->comment('评论时间');
            $table->string('replycontent')->default('')->comment('回复内容');
            $table->dateTime('replytime')->comment('回复时间');
            $table->integer('reportstatus')->default(0)->comment('举报状态0未举报1已举报2不处理3已删除');
            $table->string('reportcontent')->default('')->comment('举报内容');
            $table->dateTime('reporttime')->comment('举报时间');
            $table->integer('isdel')->default(0)->comment('是否删除');
            $table->integer('adminid')->default(0)->comment('操作人ID');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('comments');
    }
}
